load(
    "//bazel:skia_rules.bzl",
    "skia_cc_library",
    "skia_filegroup",
)

skia_filegroup(
    name = "hdrs",
    srcs = [
        "SkPngRustEncoder.h",
    ],
)

skia_filegroup(
    name = "srcs",
    srcs = [
        "SkPngRustEncoder.cpp",
        "impl/SkPngRustEncoderImpl.cpp",
        "impl/SkPngRustEncoderImpl.h",
    ],
)

skia_cc_library(
    name = "encoder",
    srcs = [":srcs"],
    hdrs = [
        ":hdrs",
        "//include/encode:encode_hdrs",
    ],
    defines = ["SK_CODEC_ENCODES_PNG_WITH_RUST"],
    features = ["layering_check"],
    deps = [
        "//:core",
        "//experimental/rust_png/ffi:cxx_bridge",
        "//experimental/rust_png/ffi:ffi_cpp",
        "//experimental/rust_png/ffi:utils",
        "//src/base",
        "//src/codec:any_decoder",
        "//src/encode:encoder_common",
        "//src/encode:png_encode_base",
        "@cxx//:core-lib",
    ],
)
